package urnav.example.com;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;



public class Qrun extends Activity{
	
	String TAG = "URNav";
	String fragen= " ";
	
	public void onCreate(Bundle savedInstanceState){
	
		super.onCreate(savedInstanceState);
		setContentView(R.layout.qeindeutig);
//		Bundle extras = getIntent().getExtras();
//		String name = extras.getString("name");
		
		
    
    final TextView myText;
    myText = (TextView)findViewById(R.id.textView1);
    myText.setText("Haben Sie die Fragen zu Alter und Geschlecht schon beantwortet? ");

    final Button closeButton;
     closeButton = (Button)findViewById(R.id.button1);
     closeButton.setText("OK");
     
     OnClickListener radio_listener = new OnClickListener() {
 	    public void onClick(View v) {
 	        // Perform action on clicks
 	        RadioButton rb = (RadioButton) v;
// 	       Log.i(TAG, rb.getText().toString());
 	       fragen = rb.getText().toString();
 	        
 	
 	    }
 	};
     
     final RadioButton radio_1 = (RadioButton) findViewById(R.id.radioButton1);
     final RadioButton radio_2 = (RadioButton) findViewById(R.id.radioButton2);
     radio_1.setOnClickListener(radio_listener);
     radio_2.setOnClickListener(radio_listener);

     


     
     closeButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

        	Intent resultIntent = new Intent();
        	resultIntent.putExtra("Fragen", fragen);
        	if (!(fragen.equals(""))) {
        	setResult(RESULT_OK, resultIntent);
        	
        	finish();
        	}
        } });

}
	
	
	protected void onDestroy(){


		super.onDestroy();
		
	}
	
	protected void onResume(){

		
	super.onResume();
	}
	protected void onPause(){

		super.onPause();
		
	}
}